package routes

import (
	"goserver/handlers"
	"net/http"
	"os"
	"path"
)

func SetupFileRoutes() {
	PublicDir := path.Join(".", "public")
	fileHandler := handlers.NewFileHandler(PublicDir)
	http.HandleFunc("/upload", fileHandler.Upload)

	PictureDir := http.FileServer(http.FS(os.DirFS("public")))
	http.Handle("/public/", http.StripPrefix("/public/", PictureDir))

}
